<template>
  <div>
    <div v-show="this.$route.query.mid ==='introduction'" style="border-bottom: 1px solid gray;text-align:center;margin-bottom:20px">
      <h2>Introduction of Center</h2>
    </div>

    <Opportunity :json_path="json_path"/>
  </div>
</template>

<script>
import Opportunity from '../components/Opportunity/Opportunity.vue'



export default {
  components: { Opportunity },
  data() {
    return {
      json_path: "",
      midL: {
        "opportunity":"/json/MarkdownOpportunities.json",
        "introduction":"/json/MarkdownIntroduction.json",
      },
    };
  },
  watch: {
    //监听路由是否变化
    '$route' (to, from) { 
      if(to.query.mid != from.query.mid){
        this.init();
      }
    }
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      this.json_path = this.midL[this.$route.query.mid]
    },
  },
}
</script>

<style>

</style>
